<template>
  <div id="selectionlist" class="xuanbuDetail">
    <section class="wboxnoborder">
          <div v-show="loading">加载中...</div>
          <el-form ref="form"
            v-show="!loading"
            label-width="150px"
            label-position="right">
            <h3>报部信息</h3>
            <el-form-item label="时间">
              <span class="selectioncontent">{{detail.reportDate}}</span>
            </el-form-item>
            <el-form-item label="附件">
              <div  v-for="(item, index) of detail.reportBatchFiles" :key="index">
                <a :href="$http.defaults.baseURL+$http.defaults.selectionAPI+'api/gen/file/download?id='+item.id">{{item.fileName}}.{{item.fileType}}</a>
              </div>
            </el-form-item>
            <el-form-item label="部领导批示" prop="leaderOpinion">
              <leaderOpinion :recordId="detail.reportBatchId" recordTable="bus_report_batch" :leaderType="1" :canEdit="false"></leaderOpinion>
            </el-form-item>
            <el-form-item label="司领导批示" prop="leaderOpinion2">
              <leaderOpinion :recordId="detail.reportBatchId" recordTable="bus_report_batch" :leaderType="2" :canEdit="false"></leaderOpinion>
            </el-form-item>
          <div style="border-top:1px solid #74A6CC;margin-top:20px;clear:both"></div>
            <h3>会议审议信息</h3>
            <el-form-item label="会议信息">
              <span class="selectioncontent">{{detail.meetingDate}} 第{{detail.meetingTimes}}次司办会</span>
              <span class="selectioncontent" v-if="detail.meetingTimes2&&detail.meetingTimes2!==''">{{detail.meetingDate2}} 第{{detail.meetingTimes2}}次党组会</span>
            </el-form-item>
            <el-form-item label="备注">
              <span class="selectioncontent">{{detail.decisionContent}}</span>
            </el-form-item>
            <el-form-item label="会议纪要">
              <div v-for="(item, index) of detail.decisionMeetingFiles" :key="index">
                <a :href="$http.defaults.baseURL+$http.defaults.selectionAPI+'api/gen/file/download?id='+item.id">{{item.fileName}}.{{item.fileType}}</a>
              </div>
            </el-form-item>
            <el-form-item label="审定情况">
              <span class="selectioncontent">
                <template v-if="detail.stateDecisionMeeting===2">通过</template>
                <template v-else-if="detail.stateDecisionMeeting===3">未通过</template>
              </span>
            </el-form-item>
          </el-form>
          <notice :noticePersonId="personId" step="5"></notice>
    </section>
  </div>
</template>

<script>
import notice from '../common/Notice'
import leaderOpinion from '../common/leaderOpinion'
export default {
  props: ['personId'],
  watch: {
    personId: {
      handler (val, oldVal) {
        this.getDetail(val)
      },
      immediate: true
    }
  },
  components: {
    notice, leaderOpinion
  },
  data () {
    return {
      loading: false,
      msgArr: ['无', '党组会', '司办会'],
      noticeVisible: false,
      detail: {},
      tableHeight: 100
    }
  },
  methods: {
    getDetail (personid) {
      if (personid) {
        this.loading = true
        this.$http
          .get(this.$http.defaults.selectionAPI + `api/selection/decision/getPersonDecisionStepInfo?personId=` + personid)
          .then(response => {
            this.loading = false
            if (response.data.success) {
              this.detail = response.data.result
            } else {
              this.$message({
                message: '获取失败:' + response.data.message,
                type: 'error'
              })
            }
          })
          .catch(error => {
            this.loading = false
            this.$message({
              message: '网络获取失败:' + error,
              type: 'error'
            })
          })
      }
    }
  }
}
</script>

<style>
.xuanbuDetail .el-form-item{
  margin-bottom:0;
}
  #selectionlist .wboxnoborder .el-table{
    border: #95B8E7 solid 1px;
  }
  #selectionlist .wboxnoborder .el-table th{
    font-weight: normal;
    background-image: linear-gradient(to bottom , #f8f8f8, #efefef);
    text-align: center;
    border-right: #95B8E7 solid 1px;
    border-bottom: #95B8E7 solid 1px;
    min-height: 30px;
    line-height:30px;
  }
  #selectionlist .wboxnoborder .el-table td, .el-table th{
    padding:0;
    font-size:var(--size14) !important;
    line-height: 20px;
    font-family: '宋体';
    text-align: center;
  }
  #selectionlist .el-table__row{
    height: 50px;
  }
</style>
<style scoped>
  #selectionlist .cell i {
    width: 30px;
    height: 30px;
    background-position: center center;
    background-repeat: no-repeat;
    float: center;
    display: block;
    cursor: pointer;
    margin: 0 auto;
  }
  .workflowmsg ul{
    background:#F5F7FA;
    margin:0 20px 20px;
    padding:10px 0;
  }
  .workflowmsg li{
    padding:0;
    list-style: none;
    margin-left:20px;
    line-height: 200%;
    font-size:var(--size) !important;
  }
  h1{
    font-size:var(--size16) !important;
    font-weight: bolder;
    height: 30px;
    border-bottom: 1px solid #95B8E7;
    font-family: '宋体';
    line-height: 30px;
    color: #000;
    padding-left:10px;
    background-image: linear-gradient(to bottom , #EEF4FF, #E0ECFF);
    margin:0;
  }
  h3{
    font-size:var(--size16) !important;
    font-weight: bolder;
    padding-left: 20px;
  }
  .el-pagination{
    float: left;
    padding:7px 10px;
  }
  .wboxs{
    padding:5px 15px;
    width: calc(100% - 30px);
    background: #fff;
    border: 1px solid #95B8E7;
    margin:0 10px;
    overflow: hidden;
  }
  #selectionlist .wboxnoborder{
    padding:0;
    width: calc(100% - 0px);
    background: #fff;
    margin:0 10px;
    overflow: hidden;
  }
</style>
